{% extends 'base.html' %}

{% block title %}
    分享一篇文章
{% endblock %}

{% block content %}
    {% if sent %}
        <h1>邮件发送成功</h1>
        <p>
            "{{ post.title }}" 已经成功发送到{{ form.cleaned_data.to }}.
        </p>
    {% else %}
        <h1>通过邮件分享"{{ post.title }}"</h1>
        <form action="" method="post">
            {{ form.as_p }}
            {% csrf_token %}
            <input type="submit" value="发送邮件">
        </form>
    {% endif %}
{% endblock %}